package com.rongke.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.rongke.mapper.ClassifyMapper;
import com.rongke.model.Classify;
import com.rongke.service.ClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassifyServiceImpl
 * @二级分类ServiceImpl
 * @version : Ver 1.0
 */
@Service
public class ClassifyServiceImpl extends ServiceImpl<ClassifyMapper, Classify> implements ClassifyService {
    @Autowired
    private ClassifyMapper classifyMapper;

    /**
     * 根据一级分类获取分类中的二级分类
     * @param classifyType
     * @return
     */
    @Override
    public List<Classify> selectClassifyListByType(String classifyType) {
        return classifyMapper.selectClassifyListByType(classifyType);
    }

    /**
     * 获取一级分类列表
     * @return
     */
    @Override
    public List<Classify> getFirstClassifyList() {
        return classifyMapper.getFirstClassifyList();
    }

    /**
     * @级联删除
     * @param id
     */
    @Override
    public void deleteByClassifyType(Long id) {
        classifyMapper.deleteByClassifyType(id);
    }


}
